Skip to main content

fast path manipulation module written in Rust

Project description

fpath

Python's os.path module written in Rust

Requirements

$ pip install setuptools_rust
$ rustup default nightly

Installation

$ pip install --upgrade git+https://github.com/hhatto/fpath

Usage

>>> import os.path
>>> import fpath
>>> os.path.abspath("path/to/file")
'/home/user/path/to/file'
>>> fpath.abspath("path/to/file")
'/home/user/path/to/file'
>>> import timeit
>>> timeit.timeit('import os.path;os.path.abspath("path/to/file")', number=1000*10)
0.20972810598323122
>>> timeit.timeit('import fpath;fpath.abspath("path/to/file")', number=1000*10)
0.12387347500771284
>>>

Benchmark

methodname              %        real[p,r]        user[p,r]        sys[p,r]       n
abspath            45.53%   10.15s,  5.53s    6.86s,  2.81s   3.25s,  2.69s  100000
basename           53.52%    0.71s,  0.33s    0.70s,  0.33s   0.00s,  0.00s  100000
dirname            57.43%    1.02s,  0.43s    1.01s,  0.43s   0.00s,  0.00s  100000
isabs              56.55%    0.59s,  0.25s    0.59s,  0.25s   0.00s,  0.00s  100000
islink              0.25%    3.78s,  3.77s    0.01s,  0.01s   0.01s,  0.00s      50
exists              0.25%    3.78s,  3.77s    0.01s,  0.01s   0.01s,  0.00s      50
lexists             0.70%    3.77s,  3.74s    0.01s,  0.01s   0.01s,  0.00s      50
split              53.85%    1.17s,  0.54s    1.17s,  0.54s   0.00s,  0.00s  100000
splitext           62.02%    1.22s,  0.46s    1.21s,  0.46s   0.00s,  0.00s  100000
relpath            52.97%    0.02s,  0.01s    0.01s,  0.01s   0.01s,  0.00s      50
normpath           57.27%    2.02s,  0.86s    2.01s,  0.86s   0.00s,  0.00s  100000
realpath            1.08%   13.39s, 13.25s    0.05s,  0.02s   0.02s,  0.03s      50
join               23.01%    0.24s,  0.19s    0.24s,  0.18s   0.00s,  0.00s  100000
expanduser         67.45%    1.50s,  0.49s    1.49s,  0.48s   0.00s,  0.00s  100000
expandvars         61.37%    1.21s,  0.47s    1.19s,  0.47s   0.00s,  0.00s  100000

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

fpath-0.1.2.tar.gz (2.7 kB view details)

Uploaded Source

Built Distributions

fpath-0.1.2-cp37-cp37m-macosx_10_11_x86_64.whl (492.3 kB view details)

Uploaded CPython 3.7m macOS 10.11+ x86-64

fpath-0.1.2-cp27-cp27m-macosx_10_11_x86_64.whl (497.4 kB view details)

Uploaded CPython 2.7m macOS 10.11+ x86-64

File details

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

File metadata

  • Download URL: fpath-0.1.2.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for fpath-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2456e2c9ca3abe284158231dd387105216d7aac2883d696b87ad81739c9d8cf1
MD5 4288863ad433d643b9b6b3326548191d
BLAKE2b-256 9ff39d14d39ace69ca78e2923e7e03404b4e292298d2f574c3bddab12d888180

See more details on using hashes here.

File details

Details for the file fpath-0.1.2-cp37-cp37m-macosx_10_11_x86_64.whl.

File metadata

  • Download URL: fpath-0.1.2-cp37-cp37m-macosx_10_11_x86_64.whl
  • Upload date:
  • Size: 492.3 kB
  • Tags: CPython 3.7m, macOS 10.11+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for fpath-0.1.2-cp37-cp37m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 135ad59a7250587cebe2371b59a900c349f12b2a40a9cdd843f729d24cee8bcb
MD5 6e09ed15efc3cb8a82081d17c7ca1740
BLAKE2b-256 7bda95a1aed12ae2e830a847bc283bf0dfb4b852e2afaba769b22f1e6d186a3f

See more details on using hashes here.

File details

Details for the file fpath-0.1.2-cp27-cp27m-macosx_10_11_x86_64.whl.

File metadata

  • Download URL: fpath-0.1.2-cp27-cp27m-macosx_10_11_x86_64.whl
  • Upload date:
  • Size: 497.4 kB
  • Tags: CPython 2.7m, macOS 10.11+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for fpath-0.1.2-cp27-cp27m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 30acf4d04018afb816e45b590019e84417d6f60c06ca274071d687ffca795712
MD5 c93d5b3bfecd78416f443ffad6f2812b
BLAKE2b-256 1fae845e798b5f026f1ff5908160f5ee46163c7ec2a4dd480e738b79076334b7

See more details on using hashes here.

Supported by

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