Skip to main content

A project for installing packages across the virtualenv boundary.

Project description

===============================================================================
mork: A project for installing packages across the virtualenv boundary.
===============================================================================

.. image:: https://img.shields.io/pypi/v/mork.svg
:target: https://pypi.org/project/mork

.. image:: https://img.shields.io/pypi/l/mork.svg
:target: https://pypi.org/project/mork

.. image:: https://api.travis-ci.com/sarugaku/mork.svg?branch=master
:target: https://travis-ci.com/sarugaku/mork

.. image:: https://ci.appveyor.com/api/projects/status/y9kpdaqy4di5nhyk/branch/master?svg=true
:target: https://ci.appveyor.com/project/sarugaku/mork

.. image:: https://img.shields.io/pypi/pyversions/mork.svg
:target: https://pypi.org/project/mork

.. image:: https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg
:target: https://saythanks.io/to/techalchemy

.. image:: https://readthedocs.org/projects/mork/badge/?version=latest
:target: https://mork.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

Summary
=======

Mork_ is a library designed for installing and querying python packages inside virtual
environments.


🐉 See What's Installed
-----------------------

::

>>> import mork
>>> venv = mork.VirtualEnv.from_project_path('/home/user/git/pipenv')
>>> dists = venv.get_distributions()
>>> [dist for dist in dists][:3]
[wheel 0.31.1 (/home/user/.virtualenvs/pipenv-MfOPs1lW/lib/python3.7/site-packages), Werkzeug 0.14.1 (/home/user/.virtualenvs/pipenv-MfOPs1lW/lib/python3.7/site-packages), vistir 0.1.4 (/home/user/.virtualenvs/pipenv-MfOPs1lW/lib/python3.7/site-packages)]


🐉 Install A Package
--------------------

::

>>> from requirementslib.models.requirements import Requirement
>>> r = Requirement.from_line("requests")
>>> venv.install(r, editable=False)


🐉 Uninstall a Package
----------------------

::

>>> pkg = "pytz"
>>> with venv.uninstall(pkg, auto_confirm=True) as uninstall:
if uninstall.paths:
cleaned = pkg
>>> print("Removed package: %s" % cleaned)


🐉 Display Information about Python
-----------------------------------

::

>>> venv.python
'/home/user/.virtualenvs/pipenv-MfOPs1lW/bin/python'
>>> venv.python_version
'3.7'


🐉 Run Commands Inside the Virtualenv
-------------------------------------

::

>>> cmd = venv.run("env")
>>> [line for line in cmd.out.splitlines() if line.startswith("VIRTUAL_ENV")]
['VIRTUAL_ENV=/user/hawk/.virtualenvs/pipenv-MfOPs1lW']
>>> cmd = venv.run_py(["import os; print(os.environ.get('VIRTUAL_ENV'))"])
Deactivating virtualenv...
>>> cmd.out
'/home/user/.virtualenvs/pipenv-MfOPs1lW\n'
>>> with venv.activated():
print(os.environ["VIRTUAL_ENV"])
/home/hawk/.virtualenvs/pipenv-MfOPs1lW


`Read the documentation <https://mork.readthedocs.io/>`__.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mork-0.1.1.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

mork-0.1.1-py2.py3-none-any.whl (7.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file mork-0.1.1.tar.gz.

File metadata

  • Download URL: mork-0.1.1.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

File hashes

Hashes for mork-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bca61f20754f9432a7eec1874103b8fb6461a747e7b9b7dddcbd2fd6f9ffde32
MD5 8c12bc4f2a8356ef2988c5f861d1939e
BLAKE2b-256 8493d8c00bac6bd9a75f952a386ef841e563ac4aec6810a39f473f72939ae90f

See more details on using hashes here.

File details

Details for the file mork-0.1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: mork-0.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

File hashes

Hashes for mork-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2a85d76bf669fd27d2532fa6721fc76fb7815d7ae7de62e095353f8aa845818c
MD5 e8c89281d14d1f5b1e5ae29885b790ef
BLAKE2b-256 d01507e9b6da2f5e0f772b8cb22fbf42eae2dc647c7b7c8646a7127b7ab4f8b8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page