Skip to main content
https://badge.fury.io/py/manuscript.png https://pypip.in/d/manuscript/badge.png

Manuscript helps you manage your python scripts and their dependencies

Python still is a scripting language, and it is awesome for this. Moreover, we now have some great libraries that make writing scripts even easier, like requests, docopt or pathlib. However, having to install them system-wide, or start worrying about virtualenv for just one script is annoying. Manuscript is here to help you handle that.

Just add a line of the form #deps: requests docopt pathlib to your script, and manuscript will install them in a virtualenv and create a wrapper for you.

Install

You can get it on pypi with the usual pip install manuscript.

You can also install manuscript using manuscript! For this, use this line get manuscript and its dependencies, and use manuscript to install itself:

cd /tmp && wget https://bitbucket.org/pitrou/pathlib/raw/e39c980b59a9705fe60f24e36cb202771af88256/pathlib.py https://raw.github.com/docopt/docopt/0.6.1/docopt.py https://raw.github.com/madjar/manuscript/master/manuscript.py && python3 manuscript.py install -c manuscript.py

Once it’s done, I recommend you add ~/.manuscript/bin/ to your path, to make it easier to access installed scripts.

Manuscript requires python 3.

Usage

You just wrote some_awesome_script.py that uses requests and docopt, and you want to use it on your system without worrying about the dependencies. Just add this line somewhere in your script:

#deps requests docopt

Then run manuscript:

manuscript install some_awesome_script.py

This will install all the dependencies in a virtualenv and create a wrapper around the script as ~/.manuscript/bin/some_awesome_script.

The virtualenv will use the interpreter mentioned in the script’s shebang, falling back to python if none is found. You can force an interpreter with the -i option, like so:

manuscript install some_awesome_script.py -i pypy

If you don’t want a script to share the default virtualenv with other scripts, you can specify a virtualenv name in which to install the script’s dependencies (it will be created if needed):

manuscript install some_awesome_script.py -e awesome-venv

If you want to reuse an env created by virtualenv-wrapper, you can pass workon:NAME as the environment name. Manuscript will use the WORKON_HOME environment variable to find it. If it does not exist, manuscript will not create it.

If you edit you script to add more dependencies, just run:

manuscript check-deps

This will install all missing dependencies for all the scripts.

Finally, if you want to use manuscript on a script that won’t last (something downloaded from the internet that sits on your /tmp for example), just add the -c argument: manuscript will first copy the script to a safe place, then do the whole dance.

Contribute

The source code is available on github.

Bug reports and pull requests welcomed !

Author

This project is made by Georges Dubus <georges.dubus@gmail.com>. You can find me on twitter: @georgesdubus.

History

0.2.0 (201-01-08)

  • Added an option to choose the name of the env. If it begins with “workon:”, use a virtualenv-wrapper env.

0.1.0 (2013-11-11)

  • First release on PyPI.

Metadata

Release files for manuscript 0.2.0

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

Source distribution (sdist)

Source distribution for manuscript 0.2.0
File Size Uploaded Provenance Actions
manuscript-0.2.0.tar.gz 6.0 kB Without provenance Details for manuscript-0.2.0.tar.gz

Release files / manuscript-0.2.0.tar.gz

Download URL manuscript-0.2.0.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7509f16bdc8770ec43f2bacaca21115d05c348d5d181b694294a9bb60bcc7be8
BLAKE2b-256 checksum
How to use checksums
c328a0e720d4a997250c5253c0fe17c1865fa88d55b686a6880cf54ac376cf5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for manuscript 0.2.0

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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 release file No provenance

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