Skip to content

mahanmarwat/path

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Path: Path for Pretty People

Join the chat at https://gitter.im/mahanmarwat/path Documentation Status

Path provide highly readable API to access and manipulate both filesystem path and URL path.

All operations are available at module level as functions.

>>> import path
>>> path.cwd() # return current working directory.
>>> path.chd() # change current working directory.
...

Operations are available as Path object methods too.

>>> p = path.Path('c:\\hello\world.py')
>>> p.name
'world'
>>> p.ext
'.py'
>>> p.ispath(path.EXIST) # check path or file existence.
>>> p.isempty() # whether the file or dir is empty.
...

Individual classes for readability.

>>> comp = path.Components('c:\\hello\world.py')
>>> comp.name
'world'
>>> comp.ext
'.py'

Unlike other packages, path also work on URL too. Which ease web-scrapper coding.

>>> p = path.HttpPath('https://github.com/docopt/docopt')
>>> p.path
'/docopt/docopt'
>>> p.create() # will create dir or file according to args.
...

Features

  • Work both on path and URL
  • Highly readable API
  • Provide constants
  • Operations are available as functions and methods
  • Individual classes for everything

Installation

$ pip install https://github.com/mahanmarwat/path/archive/master.zip

Documentation

http://path.readthedocs.org

Check path.py which is self explanatory.

I am not pretty, can I still use it?

Sorry No, LOL! Yes you can.

Contribute

Give us a star.

About

Intelligent Path Module for Pretty People

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages