Skip to main content

simple converter py<->notebook with sync function

Project description

License CI Tests Coverage Bandit Black Docs Wheel Status PRs welcome

simple converter for pa files vs notebooks

example:

from pytonb import write_notebook, write_script
write_notebook('filename.py')

writes notebook filename.ipynb. optional parameters:

  • save_name, notebook file name
  • use_ast, ignore notebook markers (In[ ]:), create a separate cell for each function
write_script('filename.ipynb')

writes filename.py, including notebook markers (In[ ]:). optional parameters:

  • save_name, py file name
  • overwrite, write over existing py file

example syncing notebook to py file:

from pytonb import sync, sync_folder
sync('filename.ipynb')

sync ipynb file to filename.py. optional parameters:

  • py_path: py file save path
  • delay: delay in s before checking change

example syncing folder to py files:

from pytonb import sync, sync_folder           
sync_folder('folder')

sync ipynb files in folder to corresponding py files. optional parameters:

  • recursion_level: sync ipynb files up to this depth
  • delay: delay in s before checking change

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

pytonb-0.1.2.tar.gz (158.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytonb-0.1.2-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file pytonb-0.1.2.tar.gz.

File metadata

  • Download URL: pytonb-0.1.2.tar.gz
  • Upload date:
  • Size: 158.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pytonb-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ae762aaa2068239af4252b5bfb3c2f6562201f1b181f18d0f50bd5c4cbf7a2d4
MD5 ac8148a9538dfb4bb823e4d8e568677c
BLAKE2b-256 3bca6af90516feef1dc9f79aa7ace98f26d1e1bc6979d6dbd1c6c036f942792c

See more details on using hashes here.

File details

Details for the file pytonb-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pytonb-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pytonb-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cc11d7f86503f2b807ee603ee2ba4b694275453673ec48eaa92bc57c2b41ad68
MD5 d2846183a4329f0e96a6ddbf5d424b21
BLAKE2b-256 1b9b5222a2903c763bf91f14314063352ad6fb57a620f9065c50451cba029c0b

See more details on using hashes here.

Supported by

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