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.6-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6ee3c7c78ed8ba9b88dcf6cc98e06a454a3a4209198991381e27d7bdd32f396 |
|
MD5 | a5a0376aa6472e8b2a286627e80f5a75 |
|
BLAKE2b-256 | 8e8ec0e0b518de67b6dd3787adbb2404c50ff684f7fa64ffc40cb159d204a4a9 |
Hashes for ffcount-0.1.6-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc965e5e773b732f420719be49e9a7f30fa32148ee471555fbddd3923f9eee2c |
|
MD5 | 0264b95320a7fb1ea4371e5931982639 |
|
BLAKE2b-256 | d673c5d063a80dbed612da99b3245b14790ef1a6a3b6096317114df70dcaa8b0 |
Hashes for ffcount-0.1.6-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7de12b3b5309586ff00a20d16ef7b125337565082512d2c15ba1897e9d487fa2 |
|
MD5 | bcc23402b516ab7291ca18f21df92988 |
|
BLAKE2b-256 | 211a77aa7a2db4174c1288773e9240d8aeeeac4d86d9c8c2fa834a0952bf50c4 |
Hashes for ffcount-0.1.6-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5deddd2335bf48381dbc1c457095ce0120e6fbdc97a1d92097adbbeafdc3a9e |
|
MD5 | 72e902704a3c4247cd8338b942fce57c |
|
BLAKE2b-256 | ff7ae00b65ad32422657964a3c851b35b5fb01e85b907bf5d424bd62f101b812 |
Hashes for ffcount-0.1.6-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8683cf527cce074da066681d040b4cb40601d54ae1a20d674e48ce4e4c8eab0d |
|
MD5 | de6af233fb43dd88ccb3818737cfaa0c |
|
BLAKE2b-256 | 0bfc70f401e5656324ac697522be35f3d86b3b9cf7182bbc97a66bbaf5abda4f |
Hashes for ffcount-0.1.6-cp38-cp38-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d560abc837e17c1f0d8852ff2c2bd97d7331a7de7aa55bb9cd050d81f53b5c7 |
|
MD5 | 15b819a97c7934304fcf543f5970df5f |
|
BLAKE2b-256 | 9c1bc6f93245146e61b66b653ceb07124ab0199da49e01d5afd904752e947906 |
Hashes for ffcount-0.1.6-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccddf31814da8139ba6791f1f0ae2bedc22dde7a8aefab221674dfb433c85a33 |
|
MD5 | 71760ef53bb6cb830d8709243b457793 |
|
BLAKE2b-256 | 89eb58e7cc2b3b3ed9f5f8006e2957292b1e9c3d494b1a7b0a54da02aa4654cd |
Hashes for ffcount-0.1.6-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 846cfebc919ddcf45bb10cad7abf8ef3cc9febad99201499f7a907d5ff4ea14d |
|
MD5 | 2267220d5c9fef6e53361aa780237a25 |
|
BLAKE2b-256 | 24887066c9824e912019a37495f6ee671a341954aa2491a304fe9c96ba0e3968 |
Hashes for ffcount-0.1.6-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 123be728a78334206273ba3a48d5328becd80a0c9228f8e2ac951d49670be563 |
|
MD5 | 5b8451d8fc653d79f2d329d59685bf30 |
|
BLAKE2b-256 | edf132d3612a1c940a7aeeac8772026d2b8301062f3b87074db849252daa03ef |
Hashes for ffcount-0.1.6-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5928375ba0cdf306e074bb2033198932280c7c2775385dbf9915b53a6f27a4c |
|
MD5 | 2e9aede4bc2d3b5ba8daa84cb1d496d0 |
|
BLAKE2b-256 | 80404d4e02e8ca4db52478e2b75b4b653a0cf38c5cab2d08096e9af28f887dba |
Hashes for ffcount-0.1.6-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 486d63f44e7f151d631053e57df4836478493261c4db063aebd0adccb307175d |
|
MD5 | f4f5cf7253f30e1d801a14d6e45ce3c5 |
|
BLAKE2b-256 | e9a5e9fdbb4b12f305912a3de1d7f86151a1c76794aa4e6f3642da55dc8079cb |
Hashes for ffcount-0.1.6-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99f60708986311d0b4f2d914df5c00aefdd17852cb8ee4fb97acfd764b89fbdf |
|
MD5 | 0276272cd38cd6473fed59181d5fb8d0 |
|
BLAKE2b-256 | de20953c3e4150208cb19a446f4737e43dcff0d128b1c37c651e59e351b8d0ad |
Hashes for ffcount-0.1.6-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8618f9c78cc3789282e731faab88bbfe5e64f913ccdb8dcc81344bc739498f45 |
|
MD5 | b8a15da64119bd269b3dd2f656549c83 |
|
BLAKE2b-256 | ae663e41191911970791e0b9d354257f95b2f74612d492fd3de2a02927507fbd |
Hashes for ffcount-0.1.6-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3adf49c6f5b39f3e6de55b084c65ba7cdb854770fbce01ee33afaa328e36cd46 |
|
MD5 | cc21c3f1d09441e2dc5b83a87d51f2d7 |
|
BLAKE2b-256 | 785c0bbc71f990a461c4984ea39eac81e18a021c99a9e01f24502e8adcaa7a9e |
Hashes for ffcount-0.1.6-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 011e44dd4e4e544c173136d6f30d75a867d358c47fb721d9deba1062da0ef7a0 |
|
MD5 | d9c9d6adcf566b110dd6d257d0e54712 |
|
BLAKE2b-256 | 8d7e8de19bbc975ecadaea174d6d4d600643b26901db8d6bfa0b92244da8070c |
Hashes for ffcount-0.1.6-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a60fc47bddd30b83d064c0124dc63ef88251aedbb89bba548b291cb26a77280 |
|
MD5 | 05e1649aac6cd1c4abdf4c13102ce293 |
|
BLAKE2b-256 | af142d2a70b7e7d5a5de1605cb1f1ba9b437671889d6d4bd804a7cb58b19d1a9 |
Hashes for ffcount-0.1.6-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6f2cdfd61dd3724d5491d378e39f89fc0ed1724800199728cee568b878eca75 |
|
MD5 | 134cd9e034d4edfe087a005648faf838 |
|
BLAKE2b-256 | fdb2f9d781427fa416ef33ea84ef041558ff4f19801297bad44793148c976c90 |
Hashes for ffcount-0.1.6-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db9890dc42f05ba56e4e30719be2dbb4fa2705f44b95d8e728905bca051fd95f |
|
MD5 | 769977cdeeff899fe02c843e820a9718 |
|
BLAKE2b-256 | 8abe187e387bc5a9d50c06723c639b596c06920bd94a1fcf57a1a692d36da194 |
Hashes for ffcount-0.1.6-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97a93e4b199c8b573d21fc9f4db0c104fd6e207eec221a40bb9175cb03d16ebf |
|
MD5 | f84cbe7a49ad3e11fc344ad30a040b6b |
|
BLAKE2b-256 | fecc421308c5e45a6bfb77b3b5998ac6847d14df4709902aeb2dfbe709681809 |
Hashes for ffcount-0.1.6-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29c7ff8a58e455df618c7d765662a5f72a567b2999c0036309b6588ce8a7a7ca |
|
MD5 | eeb58490bd9ddbfd039bb971d8fc965f |
|
BLAKE2b-256 | 51ddf05f22f56ead98f284be0d9a9b245c2be4e2ae3e5ebed84ba96c17ade6a3 |
Hashes for ffcount-0.1.6-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1022e9a5b043233d3105bff836e02bcd127050bef1d5f58ce93376afe015724b |
|
MD5 | c8a14f042325579121149b36b889d6a8 |
|
BLAKE2b-256 | 9f8fa3a17c2efa51cce0fdd7dd6241866fe0feca4774a61b2368c9f64218d1d5 |
Hashes for ffcount-0.1.6-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10d4ebcffdb70e95468e0e9ba708b5b5418ec3fe0c1a6e0caf67ec663ec52aaa |
|
MD5 | e1c088967e6f0cabb82e565f972387a3 |
|
BLAKE2b-256 | 8d2c489612012747e5b0eea64013fc5f2211cdb2f13d371d902258c7d92460b3 |
Hashes for ffcount-0.1.6-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f276f4fb4e023353b3c17beef3b34c98ec3f5f3760bd6eb36b63f2e4c1aeaaf |
|
MD5 | 412b149e5f6cb3a46749f2500e61d600 |
|
BLAKE2b-256 | 379991c8955c3a31e06efd6540b4776e35c6cc46a49d1b65fbc62e60cd55f175 |
Hashes for ffcount-0.1.6-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e93cc8bbb8bc5578148d79ef3b473c9e4514ab970555e57179b8920415ea22f5 |
|
MD5 | 3496a59e218a929f0313ce3691ec49fa |
|
BLAKE2b-256 | 90487bddf604da65fc0e517e80a809fdd511f45c32b2c661912233605b29e062 |
Hashes for ffcount-0.1.6-cp35-cp35m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7eaaff420db835a1cc9f21674d5d9e081e74883e2b091ee021c324ad69378473 |
|
MD5 | 0ce4d7895c98e43fbb37f21f3129a352 |
|
BLAKE2b-256 | 6964ca6a0c8f6f08fc9407a8ed4a2ae280aef56510a6ea5b8d45957f0a20f2e1 |
Hashes for ffcount-0.1.6-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6a259231654fe6a29da5255b552a42b5a386379b3e1086b955c65b2c3e05d63 |
|
MD5 | 945951b6ff398b52387ebe277173efaa |
|
BLAKE2b-256 | d2e1bb4bba56182903b7c8370566a264be15ad35b40c412324bea38c130e7978 |
Hashes for ffcount-0.1.6-cp35-cp35m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2f60b6631f37e7bf3838b9df031be8bb75db2cd0ea693507b5ce8e0a373e2f2 |
|
MD5 | dc7c4711da16267d5294c545d204b7b9 |
|
BLAKE2b-256 | c0b70721fd92c68dc72afcef6d79580583859132b2e413dbf1f138865e431539 |
Hashes for ffcount-0.1.6-cp35-cp35m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25a844e6d39597fb6d59755bb4a8db12c89c317dbd8afb2fc012fb2cdeda816c |
|
MD5 | da2575972bc265fa10fe710b6a2deb31 |
|
BLAKE2b-256 | a5d060774409428f134224ee0d81ec1e2ccf1a6651b5e5955646d70abaca72cd |