No project description provided
Project description
nokogiri
This Python library is a sharp "nokogiri" that cuts through the problems that arise in the process of trial and error, such as machine learning.
pip install nokogiri
spylus
- Now you can draw image with stylus pen or drawing tablet such as iPad, Surface and Wacom in JupyterLab/Notebook.
- Of course it senses pressure so you can control the thickness of the line.
- Clipboard image copy/paste feature supported! this is super effective for AI painting with clip studio/photoshop.
- VSCode greatly limits functionality due to policies that prohibit the execution of javascript in notebooks. Please use JupyterLab/Notebook.
screenshot
Try it
Hit this button and launch demo via binder.
from nokogiri.spylus import spylus
working_dir
Enables import of any module not in the project tree from anywhere at any time
from nokogiri.working_dir import working_dir
with working_dir("/path/to/isolated_module"):
import isolated_module
with open("isolated_data") as f:
isolated_data = f.read()
tqdm_load
Display a progress bar while reading a pickle file
from nokogiri.tqdm_load import tqdm_load
data = tqdm_load("/path/to/data.pkl")
defaultdotdict
defaultdict but also dotdict
from nokogiri.defaultdotdict import defaultdotdict
sounds = defaultdotdict(lambda: "meow")
print(sounds.dog) # "meow"
sounds["dog"] = "bow" # you can also access with []
print(sounds.dog) # "bow"
curry
currying function. add some syntax sugar for a lot of function arguments.
from nokogiri.curry import curry
# "pipe" iterable objects
@curry
def f(x):
return x+1
@curry
def g(x):
return 2*x
range(5)|f|g # [2,4,6,8,10]
# example of common use case
@curry
def f(a="a", b="b", c="c", d="d"):
return f"/{a}/{b}/{c}/{d}"
f.hoge.fuga.piyo("root") # "/root/hoge/fuga/piyo"
# syntax
f.hoge.fuga.piyo == lambda x: f(x, 'hoge', 'fuga', 'piyo')
f[1][None][True] == lambda x: f(x, 1, None, True)
f._(key="value") == lambda x: f(x, key="value")
which_env
Detect notebook environment is Jupyter or Terminal or …
from nokogiri.which_env import which_env
if which_env() == which_env.JUPYTER:
from tqdm.notebook import tqdm
else:
from tqdm import tqdm
shared_map
share large size map/dict between notebok kernels
python -m nokogiri.shared_map /path/to/*.pkl
from nokogiri.shared_map import shared_map
sm = shared_map("/path/to")
for x in tqdm(range(100)):
y = sm.hoge(x) # read from /path/to/hoge.pkl
cell
Bring Jupyter cell behavior to VSCode Python Interactive
from nokogiri.cell import cell
A = 1
B = 2
@cell()
def func(A, B):
C = A+B
D = A*B
return C, D
print(C, D) # 3, 2
code embeding test (recently I noticed that Readme.md is code-embeddable like this.)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for nokogiri-0.1.16-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53a1bd94f563cdef563ed67369ef7f3cf118d5f837926b592cc02cc4a8846161 |
|
MD5 | d5bde0420af2ca5f3a48ca1532c22c47 |
|
BLAKE2b-256 | 04a95de8323ef6cc4cb914dd77f6f815e3d1dd7763f0d6c434bfb266987f611e |