Skip to main content

personal python lib Build Status

legacy python lib see xsthunder/python-lib: useful python pieces of code

code and release

  1. code at xsthunder/xs_lib at master

  2. update xs_lib/version.py at master· xsthunder/xs_lib

  3. merge to releae and travis will deploy to pip

TODO

Features

  1. Full test with traivis to make sure things are on rail.
  2. xs_lib.ismain.main(__name__, main) to define entrance
  3. xs_lib.common.IN_TRAVIS and xs_lib.common.IN_JUPYTER to tell current state, also allow bash env setting to true or false to overwrite.
  4. xs_lib.common.CLI_TEST is read from bash env to control cli.

Install and Run

Install via xs-lib · PyPI

  1. pip install xs-lib

Use in Code

use for single ipynb file

export the ipynb file

import xs_lib.common as common

# this will choose con tqdm
for i in common.tqdm(range(3)):
    print(i)
nbe = common.NBExporter()
nbe('./pdb.ipynb', to='./')

use for projcet

clone xsthunder/jupyter_dev_template

Use in cli

nb2py --help

optional pakage tqdm

conda install tqdm

Usage suggestion

add #test_export to top of the code cell which will be exported to test and standard file.

add #export to top ot the code cell which will be exported to standard file.

use Sure 1.4.7 - Documentation — sure 1.4.7 documentation for #test_export.

Development

Environment Setup

bash ./config/create-env.sh for conda

deps

  1. not all deps are necessary. only ipython are set in the setup.py/deps.
  2. xs_lib.common supports dynamic import. feel free to import.
  3. to import other modules, please install corresponding deps first or you may come across import error.
  4. It's recommanded to install all packages listed in create-env.sh

code structures

Ref

deployment - How can I use setuptools to generate a console_scripts entry point which calls python -m mypackage? - Stack Overflow

Packaging Python Projects — Python Packaging User Guide

notebook2script from course-v3/nbs/dl2 at master · fastai/course-v3

Release files for xs-lib 0.1.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 xs-lib 0.1.0
File Size Uploaded
xs_lib-0.1.0.tar.gz 9.6 kB Details

Release files / xs_lib-0.1.0.tar.gz

Download URL xs_lib-0.1.0.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7175300a384a275d2d6dd3b1be2ce1dd82a20655aef6fdb22975f7b83319c844
BLAKE2b-256 checksum
How to use checksums
8106fea3be9619d26e9386e21619faaca284fa90d593ed002af4f4b30693ba99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

0.0.11

1 release file

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

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