Skip to content

Commit

Permalink
ADD: long project description for PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
desty2k committed Jun 18, 2021
1 parent fa33bdb commit d7eee11
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 3 deletions.
84 changes: 83 additions & 1 deletion paker/__main__.py
@@ -1,4 +1,86 @@
"""Some docs"""
"""# Paker
[![Build](https://github.com/desty2k/paker/actions/workflows/build.yml/badge.svg)](https://github.com/desty2k/paker/actions/workflows/build.yml)
[![Version](https://img.shields.io/pypi/v/paker)](https://pypi.org/project/paker/)
[![Version](https://img.shields.io/pypi/dm/paker)](https://pypi.org/project/paker/)
Paker is module for serializing and deserializing Python modules and packages.
It was inspired by [httpimporter](https://github.com/operatorequals/httpimport).
## How it works
Paker dumps entire package structure to JSON dict.
When loading package back, package is recreated with its submodules and subpackages.
## Installation
From PyPI
```shell
pip install paker
```
From source
```shell
git clone https://github.com/desty2k/paker.git
cd paker
pip install .
```
## Usage
In these examples we will use paker to serialize [mss](https://pypi.org/project/mss/) package.
### CLI
To dump module to JSON dict use `dump` command:
```shell
paker dump mss
```
To recreate module from JSON dict use `load`:
```shell
paker load mss.json
```
### In Python script
```python
import paker
import logging
file = "mss.json"
logging.basicConfig(level=logging.NOTSET)
# install mss using `pip install mss`
# serialize module
with open(file, "w+") as f:
paker.dump("mss", f, indent=4)
# now you can uninstall mss using `pip uninstall mss -y`
# load package back from dump file
with open(file, "r") as f:
loader = paker.load(f)
import mss
with mss.mss() as sct:
sct.shot()
# remove loader and clean the cache
loader.unload()
# this will throw error
import mss
```
## Bugs
Loading modules from `.pyd` files does not work.
"""


import os
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Expand Up @@ -4,7 +4,7 @@
from setuptools import setup, find_packages

# Package imports
from paker.__main__ import __version__
from paker.__main__ import __version__, __doc__ as long_desc

setup(
name='paker',
Expand All @@ -15,9 +15,10 @@
author='Wojciech Wentland',
author_email='wojciech.wentland@int.pl',
description='Serialize Python modules and packages',
long_description_content_type='text/x-rst',
long_description_content_type='text/markdown',
python_requires='>=3.5',
zip_safe=False, # don't use eggs
long_description=long_desc,
entry_points={
'console_scripts': [
'paker=paker.__main__:main_entry',
Expand Down

0 comments on commit d7eee11

Please sign in to comment.