Giter Site home page Giter Site logo

cdxjgenerator's Introduction

CDXJ Generator

A rudimentary Python 3 script to generate CDXJ TimeMaps for testing elsewhere.

Usage

To run, call the script:

python3 cdxjGenerator.py [number of lines] [URI-R]

For example:

python3 cdxjGenerator.py 12

...will generate CDXJ output (to stdout by default) consisting of entries for 12 random URIs. Alternatively:

python3 cdxjGenerator.py 25000 memento.us

...will generate 25,000 entries for the URI-R memento.us. This output can be written to a file like:

python3 cdxjGenerator.py 25000 memento.us > sample.cdxj

The resulting file will likely need to be sorted before used elsewhere. Do this via:

sort sample.cdxj -o sample_sorted.cdxj

This can also be performed in a single command, instead of writing to the temporary, unsorted sample.cdxj like:

cdxjGenerator.py 25000 memento.us | sort - > sample_sorted.cdxj

Background

TimeMaps are lists that enumerate URIs of resources that encapsulate prior states of the given resource. (RFC7089 - Memento). TimeMaps are often expressed in an extension of the Web Linking (RFC5988) format. Additional, less common formats, like JSON and CDXJ TimeMaps can also express the same information in a less rigid format. CDXJ is the most flexible of the three and is used by InterPlanetary Wayback (ipwb), which sparked the initial need for this software existing.

A Note

The most recent commit uses the Faker module to generate valid dates. Some Python environments don't like this. Generate a fresh one using python3 -m venv test_venv rather than the typical syntax to remedy the issue.

cdxjgenerator's People

Contributors

machawk1 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.