Skip to main content

Table of Contents

Here is everything frequently use in python.

Prologue

I often need to configure a new Python development environment. Whether it is to help others or for myself, it is very troublesome to manage packages with pip. Besides, there are fascinating and impressive ipython extensions, and every installation of them has to bother Google again.

Therefore, I created this napy.

This package is still under development, and although is only for myself now, you can use it as you like.

Introduction

Napy includes some packages that I frequently use in python, such as requests, for crawlers; sympy for mathematics. Also, napy has some ipython extensions I write. A template Napy also has that I often use (of course, it's still straightforward now). Hope you like it.

Due to the .dir-local.el contains (org-html-klipsify-src . nil), it is warning that it is not safe.

Usage

Tools (Libs)

Utility

Flatten

Flatten list of iterable objects.

from napy.tools import flatten, flatten_str

list(flatten([1, 2, "ab", [3, "c", [4, ["d"]]]]))
# [1, 2, "ab", 3, "c", 4, "d"]

list(flatten("abc"))
# ["a", "b", "c"]
# regard "abc" as ["a", "b", "c"]

list(flatten_str([1, 2, "ab", [3, "c", [4, ["d"]]]]))
# or list(flatten([1, 2, "ab", [3, "c", [4, ["d"]]]], True))
# [1, 2, "a", "b", 3, "c", 4, "d"]

Comand Line Tools

Template

Crawler

$ napy template --help
Usage:
  template [options]

Options:
  -c, --category[=CATEGORY]       Category of template
  -o, --output[=OUTPUT]           Output file (default: "stdout")
  -y, --yes                       Confirmation
  -h, --help                      Display this help message
  -q, --quiet                     Do not output any message
  -V, --version                   Display this application version
      --ansi                      Force ANSI output
      --no-ansi                   Disable ANSI output
  -n, --no-interaction            Do not ask any interactive question
  -v|vv|vvv, --verbose[=VERBOSE]  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
 Template command line tool.

It will generate this:

from requests_html import HtmlSession as s
import requests as req


def crawler() -> None:
    """Crawler."""
    pass


if __name__ == "__main__":
    pass

More

Still under development.

Packages

Normal

  • better_exceptions: Pretty and helpful exceptions, automatically.
  • pendulum: Python datetimes made easy.
  • tqdm: Fast, Extensible Progress Meter.

Science

  • jupyter :: Jupyter Notebook + IPython: Jupyter metapackage. Install all the Jupyter components in one go.
  • numpy: NumPy: array processing for numbers, strings, records, and objects
  • pandas: Powerful data structures for data analysis, time series, and statistics
  • sympy: Computer algebra system (CAS) in Python

Crawler

  • requests: Python HTTP for Humans.
  • requests_html: HTML Parsing for Humans.
  • BeautifulSoup4: Screen-scraping library

Development

  • cleo: Cleo allows you to create beautiful and testable command-line interfaces.

Epoligue

History

0.2.2 <2018-12-29 Sat>

  • Fix: now flatten will not flat dict any more.

0.2.1 <2018-12-22 Sat>

Add a new tool flatten

0.1.1 <2018-12-17 Mon>

Use README.md instead of README.org

0.1.0 <2018-12-16 Sun>

The beginning of everything

Metadata

Release files for napy 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for napy 0.2.2
File Size Uploaded
napy-0.2.2.tar.gz 44.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for napy 0.2.2
File Interpreter ABI Platform
napy-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 173.1 kB

Release files / napy-0.2.2.tar.gz

Download URL napy-0.2.2.tar.gz
Size 44.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7200a8b0412dcd6e354c720da875140bbc8c2cc229441295794112eeb6f1aa20
BLAKE2b-256 checksum
How to use checksums
e91dff3016dd5969b0b350c69d3a52e0beaf8eee3cc4424535d7c430dacb7050
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/0.12.10 CPython/3.7.2 Darwin/18.2.0

Release files / napy-0.2.2-py3-none-any.whl

Download URL napy-0.2.2-py3-none-any.whl
Size 128.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d9ba90b48407bb143f41ddce30999a43a6fd73466b12c959b78db4c472972a9d
BLAKE2b-256 checksum
How to use checksums
1ba60cc62b02ea86e9789e52bea83567463e7d0e402b660248ebb6adc4a1ab95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/0.12.10 CPython/3.7.2 Darwin/18.2.0

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

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