Skip to main content

r2 (Record2Replay)

Record2Replay is simple tool to record your requests on specific target and later replay it to automate your daily tasks

Note: This version is still Work In Progress. Record/Replay function should work with no problems, but it is lack of features.

TLDR;

# install
pip install r2

# record responses from another service
r2 record http://api.plos.org

# or record on the custom name 'api_plos'
r2 record http://api.plos.org --package api_plos

Go to your browser and type:

localhost:5000/search?q=title:DNA

in your home directory, all response will be saved at

~/.r2/packages/default/*

# to replay packages 
r2 replay

# or to replay a custom package 'api_plos'
r2 replay --package api_plos

TODO

Note: This is partly implemented with 0.2 version.

  • Implement an option to parse arguments ex http://127.0.0.1:5000/search?q=title:DNA. Actual version will pass everything on the right side of the ? and save a file under search.

  • Add a support for more than one package

Installation

You can install a r2 software using a python package manager or build it from source code:

from pip

r2 is available thru pip, to install type pip install r2

from source

Go into src directory of source, and type python setup.py sdist bdist_wheel && cd dist && pip install r2*.whl

Replay files

Replay files store base information about the response, from the service.

Actual support:

  • json response

Future upgrade:

  • raw response
  • additional status codes
  • additional information from headers

Logs files

All logs are stored at ~/.r2/logs directory with filenames r2_record_2020_08_04T18_06_02_050068 where (r2_[action_type]_[isoformat_time]).

Format change v0.1 to v0.2

Since version v0.2, r2 presents a new format to store response information from the services. Before v0.2 all response was stored as a raw text in the file. Now, the Response is packed:

Example:

  • Before:
{"test": "test_body"}
  • Now:
{
"data_id": "test\endpoint", 
"actions": [
    {"arguments": {}, 
     "response": {
         "test": "test_body"}
     }]
}

This approach allow us to store different information for whole range of arguments deliver thru the URL.

Metadata

Release files for r2 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for r2 0.4.2
File Size Uploaded Provenance Actions
r2-0.4.2.tar.gz 10.2 kB Without provenance Details for r2-0.4.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for r2 0.4.2
File Interpreter ABI Platform Actions
r2-0.4.2-py3-none-any.whl Python 3 none any Details for r2-0.4.2-py3-none-any.whl

Total release size: 22.2 kB

Release files / r2-0.4.2.tar.gz

Download URL r2-0.4.2.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f52ccc686be66d561a7d312132c9188aa38e4a4635095b3ccf0f2f7ed221f814
BLAKE2b-256 checksum
How to use checksums
e7e4fcb8ced781ec1995f33f1d0fc976e7d39dee3d7eb385b05806e4f85f28b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.2

Release files / r2-0.4.2-py3-none-any.whl

Download URL r2-0.4.2-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e14227bee142e99e5eef2215377e178a6c8754fa8e69078985d4fb1652df64d2
BLAKE2b-256 checksum
How to use checksums
a5e1c2070958149010f7f0f0b226f5c3bd6693f3283fc9d0fed96d0ece651efa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.2

Security for r2 0.4.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page