Fast File Count: Recursively count files and directories very quickly
Project description
Fast File Count in Python
This is a Python package to quickly count the number of files and directories in a given path. Optionally you can count recursively and include hidden files in the total.
This package is a wrapper around fast-file-count
by Christopher Schultz
. Credit for the initial version
belongs to Christopher Schultz, I wrote the Python wrapper, converted the
Windows code to use builtin functionality, and packaged it up. See the file
src/c_count.c
for the other contributors and see the commit history of
this package on GitHub for my exact changes.
Installation
Installation can be done easily with pip:
$ pip install ffcount
Usage
There is a command line application called ffcount
, which recursively
counts files and directories:
$ ffcount
See ffcount -h
for options.
The package can also be used as a Python library, using the ffcount
function. This function returns a tuple (number_of_files, number_of_dirs)
and it can be used as follows:
>>> from ffcount import ffcount
# count everything under the current path
>>> ffcount()
(521013, 43012)
# count without hidden files
>>> ffcount(hidden=False)
(234012, 12082)
# use a different path
>>> ffcount('/tmp')
(81, 10)
Note that ffcount
counts links as files, even if they point to a
directory. In some cases, this explains the discrepancy with other ways of
counting.
Docs
The full documentation of the ffcount
function is:
def ffcount(path='.', recursive=True, hidden=True, quiet=True):
"""Fast file count
Count the files and directories in the given path. By default the function
is recursive and does not print errors. This function uses the C
implementation by Christopher Schultz.
Parameters
----------
path : str or bytes
The path where to start counting. By default the current working
directory will be used.
recursive : bool
To recurse or not to recurse. If recurse is False, only the files and
directories in the directory given by ``path`` will be counted.
hidden : bool
Count hidden files and directories as well.
quiet : bool
Don't print errors to the screen. If True, the function will fail
quietly and not print any errors.
Returns
-------
files_count : int
Number of files counted.
dir_count : int
Number of directories counted.
"""
License
The original C code by Christopher Schultz was licensed under the Apache License 2.0. This package is therefore licensed under this license as well.
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 Distribution
Built Distributions
Hashes for ffcount-0.1.7-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2209370195058a8dcd307dba186da5f30e979349dadfac72b83125d0713c0f29 |
|
MD5 | 89d7a9f207a8f9d70941e4b79fe1f49e |
|
BLAKE2b-256 | a557506d25718fd34bf148ec7045d3a1cc13b85763feb5b3ed870b61a8f87236 |
Hashes for ffcount-0.1.7-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e8e4dc96e18572b05cf18ec1857d11b16cacea3beea2520e675f6a9a066826f |
|
MD5 | 519bce80c97be7f3a56f49da50ff5f75 |
|
BLAKE2b-256 | d5d65cfe27f0a0689ee8517d6b775ee68a9054640af7d70d953e29187302b131 |
Hashes for ffcount-0.1.7-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c778f2b9c438f1f1b1de99138418015d352fc58d0b99e1f9b5a194c5c76536f8 |
|
MD5 | 9c23548d1961d58dd69cbbd596953cef |
|
BLAKE2b-256 | d606f42b15eed3e9ea07a256955f7eb9070e39ff177ee8770cee64b16a079ab6 |
Hashes for ffcount-0.1.7-cp39-cp39-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5f56cf884ee745b309ba789ec53313e8592c75e37f08e9cb918a4e07c493bdc |
|
MD5 | c2e0ec279b7e6aa03997549db2d4b8e0 |
|
BLAKE2b-256 | 0e44192884159ead4320faa614d82422499ffac4e4599977310812cac7d5ded5 |
Hashes for ffcount-0.1.7-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c58c29bc5989219311f1f9d9966b750e4596d37400512d5c6fc641b92737dbe |
|
MD5 | 2e9c3bb3cb4fdb5f8ab43440ac38f726 |
|
BLAKE2b-256 | 768885e6388bfb0c0b927265f46d7530ccc09189c051fa27d202b727eaed5d2a |
Hashes for ffcount-0.1.7-cp39-cp39-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b919307a63153e6136ec44dac292bf3107b665f6694af72f85dd79619b95a19 |
|
MD5 | 35a17830c2b5a4a23c649efab3d49c35 |
|
BLAKE2b-256 | a8800bf1957ef442e911c7872f8b5dcc914f41c2271aa88e82fcdf7244edaeb1 |
Hashes for ffcount-0.1.7-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89a7124f522a24fc39339435c0374d8ee2b17e40269658046ca06d3636cfec70 |
|
MD5 | 98816e36c04ec2bcac35299bf2ad4522 |
|
BLAKE2b-256 | 25374bd0d10eb4778cd954fb30cfd657b2baed83f6a37d992662b0ac5ba3eb4f |
Hashes for ffcount-0.1.7-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 607f56937d8be5ff784bdebe33293bc4e1a00fbdbc0e29d644d00c77e974f47e |
|
MD5 | 9919b48b9bd5ff6e4456fa420fd282e0 |
|
BLAKE2b-256 | 93109128825e71394b56ffdc429e301d5fa9f61efa6cfa4cf2d11e546e73ff8d |
Hashes for ffcount-0.1.7-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2e13764aba81ae17a2ebc0f1d888a4c951633b2a47a6abc1dedee15da3e1f90 |
|
MD5 | 5c7a223e3fb8164216445b65f4eab36e |
|
BLAKE2b-256 | 706b1822afb4b18b0c8244cb45879f4615d6f92d45e991eeaccb5502b4d9301d |
Hashes for ffcount-0.1.7-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35cb7955533220220f68f695b388dc1a68a1a40d667ffba6fdd9ce966d64395d |
|
MD5 | 4b7900aa1b0b3c4a8e36e3136744fd0f |
|
BLAKE2b-256 | 75c66039f8be8e8b679a0ddf95af10d4764a05610603b774aec9d3930945182b |
Hashes for ffcount-0.1.7-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8fac97fd11ea158bce07dcd6b234a0393a27495f836e45a03568e7d0aeb8c30 |
|
MD5 | e0ec698e81f0ef25733bda4c2f138882 |
|
BLAKE2b-256 | bfb5ef9455875b9b5250d3828dbd19ec7149ed4e9d4256346a9ca58a4d8865e1 |
Hashes for ffcount-0.1.7-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2de3b0790778fc3a954ce1d10248879b125c4a15ae90af5b7ec88bfe69f1d579 |
|
MD5 | 94bbf9594e1318a3734727dd718d0b28 |
|
BLAKE2b-256 | a9debee719328a20fc9a794fd1cdbc610e743453460aea5197d1ea45a138f692 |
Hashes for ffcount-0.1.7-cp38-cp38-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92d2150ea36b9968eb868c9d70e520baf5406f9bc5ba103dc3c1e8644e48f562 |
|
MD5 | 484e1c299b9e3124de40cbb6008eeac6 |
|
BLAKE2b-256 | 9cb9020aa1b83b040110dd78ef46790f6677796be76274029bf1ac0c46861799 |
Hashes for ffcount-0.1.7-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cde396d48e2ee71f688478d34ac81d22da4fad2d9de055f3bcaeb803db9e1877 |
|
MD5 | cabd8443b9dc882e271c8303104840d7 |
|
BLAKE2b-256 | 6a1a3ff81428e305de55bfd4aabf2a58807ccbb1a5ec0b8db6664c43fcd4622d |
Hashes for ffcount-0.1.7-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7cd6904e78be677a5373030ca418299d3cbe03fb53819435f02dc98c08ee3dc |
|
MD5 | 0c43428a44189c8ca6f5a17ea6730e76 |
|
BLAKE2b-256 | 8e67d7a4e1ac38bf9109d6715b7cedb6d9aabf27a51c9f7c303776d275596543 |
Hashes for ffcount-0.1.7-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 029171d4a4611796485bab7011049a49bd1d4c80d92eabedb7cf460a2e58c5fb |
|
MD5 | f1cfde3d39908a7c924de40bd4c69af7 |
|
BLAKE2b-256 | 4d45adc4faf8f8d397ff20f9f4aa7a9cc984832f11e858b368479f5fee815ddb |
Hashes for ffcount-0.1.7-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5504f7e7abd439ee297309f02cf37b026f9c8615670e18fdec3a6f4f739b3d8 |
|
MD5 | 0e7fc6780835064dd6bfdafbbc7aa7d9 |
|
BLAKE2b-256 | 5342c85b188831471abdce115c4b6c4f0abb27e92b1cc101b6c48890455a8ef9 |
Hashes for ffcount-0.1.7-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c46d8274b9c2886fe034267bbc6b6e48902cf643d15a62dc7a6c9d92c62cbb08 |
|
MD5 | 333a793a764acfa1f1b2f3f19c021a74 |
|
BLAKE2b-256 | 1c203cb32b5e65f634fe49366917777052b398dd2e525a015c934c0dc9d551ff |
Hashes for ffcount-0.1.7-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cd108b97297260905b1dfbac859647f0394e98683448ce52bf2725249286900 |
|
MD5 | 10d10c3f248c25029c86e52f24b04980 |
|
BLAKE2b-256 | a58546cd9be0702a84237e75855d6ca8f029cedb024d9f48c1edeeffcf399854 |
Hashes for ffcount-0.1.7-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d5af1cc3465f685840d9dab9b7128343b421bdba738c83b0a0822eb3c610b49 |
|
MD5 | 5b94e1e2ebf462f57b85ecb8e5558624 |
|
BLAKE2b-256 | 800808f56a78ad1de7fa72327f5ea29fc130f9d0c4c5e4a007e9983adfe7ce12 |
Hashes for ffcount-0.1.7-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac3302783b56c324fb6d388911619ef62f468025053988a969b8a7b9d826894e |
|
MD5 | 99609a05b94eddd9afcc46561e3763fb |
|
BLAKE2b-256 | c91ac838b568dfafe42bd9cf7e07b102b1ee127dcc03972ae06038f9f873f1d9 |
Hashes for ffcount-0.1.7-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 302c79d2fddd2b4c9ff34dbaff79ee19640539a253e75022805766efbe3f2576 |
|
MD5 | 7fb66adaa931fe4f5c81d02bc7259849 |
|
BLAKE2b-256 | 78c7f813ecb06752062d32999ddf1072e874039ef5f266ca0d4d6566e890a127 |
Hashes for ffcount-0.1.7-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0af20672804da9074bb5de56b13cc17641973e4dae7b9ab5fdf76b397b9740e7 |
|
MD5 | 55b3a67b66bf6163a983707219304e4a |
|
BLAKE2b-256 | 63aa63581171da707e1ce3872c494eea11b0c340d502216ae10c9a4d485ec6d9 |
Hashes for ffcount-0.1.7-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3708c6369744b7f0d2eb8bdcd7c9e7d90bdab40d4870a4ca42975c21fd86c516 |
|
MD5 | fadf247a867b189d057f1fdf9f2f8e06 |
|
BLAKE2b-256 | 3b93a527522c76bcbcd45987968a5ec220cddca69a165014369f793fbc3b7591 |
Hashes for ffcount-0.1.7-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e635eadfae28c5a37128bf551f7536bfc95582ce180e1ba354dd350b4487240a |
|
MD5 | 800576dddc257c553f7ab735735bd3f1 |
|
BLAKE2b-256 | a00590760bcf5a14fedc2a1583f8a24cc37c0f92c9c0b314ec49e290865d1ded |
Hashes for ffcount-0.1.7-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff2a5e54da78a3c0912fef1ddf3c3d3fa6c20feb7ae0e52b68f1903ada368f09 |
|
MD5 | 5518ed85d2a8bebdb181f656e848459c |
|
BLAKE2b-256 | 330696133c3c07e4fd841de0d501000fe90abe56cc2d350f6177b9b9265ba2d3 |
Hashes for ffcount-0.1.7-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c50714a3fbdf36b47f2452da954c01f05d21a5079867f00063a92cd55cea27c |
|
MD5 | 11a3152536b15e03461357cc18353d72 |
|
BLAKE2b-256 | 85a077920c1bba9cd3055a92aadf241b2b7c19e219116720aade197113de6bd4 |
Hashes for ffcount-0.1.7-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | efe23ae526bbd63afec721a6211d80d59025a0f47e98a962c96bdbcb929e685c |
|
MD5 | 45f81c777a715650dc1de90694e52f04 |
|
BLAKE2b-256 | ffe5086f0d4bb00d9346b4efbf7320498d0e9279c35fdbc34436a55099a8b2f3 |
Hashes for ffcount-0.1.7-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b85327aa3713bb19e3af118aa13ee88ce300aa1b168b4ce755593942fd231b8f |
|
MD5 | 3622bb653ce28de956721ed4221c571e |
|
BLAKE2b-256 | 2b0cb4438e9389e6b716422ca344ff7a20090c7c05f21e69bd6cca9abefc9dfd |
Hashes for ffcount-0.1.7-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8279ef26050d5566174ea293ed524ee1d3d2ad4e013bf750cbd3380fe3ac1b14 |
|
MD5 | 30f0a505a66b31aadd984176daa4e268 |
|
BLAKE2b-256 | 1e5610ba1be7d077d1ee9d86151d0622c4b1aa2345831797bf1e605cb5f77d37 |
Hashes for ffcount-0.1.7-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05857ea7fdf1ef7bddba350cb4351a70026580abe4d4abc7fe48730de28fc901 |
|
MD5 | 855e39b9c767e5daee305c53988d36f8 |
|
BLAKE2b-256 | e63bc994f961c44ee74acde4a817c3425bfc322d8a2be2684dba8f45feb010a0 |
Hashes for ffcount-0.1.7-cp35-cp35m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d7f5c8e13d8672fc2c5b666904731c4276442d9e71dc85218fa31b1a661dd9b |
|
MD5 | 941f569bdbfef420f2645280904b12af |
|
BLAKE2b-256 | f3644c0dd2f11ede646d712ad15a86071a9a92737fec8ae89b10deb7bf9e80a1 |
Hashes for ffcount-0.1.7-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 397bfab08b63bef2d16883f242213abdaff76d0ff6c042d187220b1eb7ab5d48 |
|
MD5 | ef31bd244edd7e7c92a0a53962e7cd92 |
|
BLAKE2b-256 | c6867862ff842cc4d97842150db1c752a9389c53fd3971864a359184a7251258 |
Hashes for ffcount-0.1.7-cp35-cp35m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35a360b42d8ba481dcbfcf7ff0d425701189451295dd833c15dd5fb37f714fcb |
|
MD5 | 2edb7e8257667573ecc584215b045bfe |
|
BLAKE2b-256 | a57b401676a16a07b2df08bef01eb2e4d8a64e934ce4be8658200ca06ce3d37e |
Hashes for ffcount-0.1.7-cp35-cp35m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 274ec5740bb52433f74c7daa9e065c4d716880a321780416f8a94c197813e958 |
|
MD5 | 5a24b90542f44dfda6178fb41fe06f96 |
|
BLAKE2b-256 | e6148b6d8627f824f132e8348636ff24098baca1eebe7ad555880d632c6a0ef1 |