Ravenports generated: 04 Feb 2024 05:27
[ravenports.git] / bucket_A7 / python-fs
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               python-fs
4 VERSION=                2.4.16
5 KEYWORDS=               python
6 VARIANTS=               v11 v12
7 SDESC[v11]=             Python's filesystem abstraction layer (3.11)
8 SDESC[v12]=             Python's filesystem abstraction layer (3.12)
9 HOMEPAGE=               https://github.com/PyFilesystem/pyfilesystem2
10 CONTACT=                Python_Automaton[python@ironwolf.systems]
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            PYPIWHL/b9/5c/a3d95dc1ec6cdeb032d789b552ecc76effa3557ea9186e1566df6aac18df
14 DISTFILE[1]=            fs-2.4.16-py2.py3-none-any.whl:main
15 DF_INDEX=               1
16 SPKGS[v11]=             single
17 SPKGS[v12]=             single
18
19 OPTIONS_AVAILABLE=      PY311 PY312
20 OPTIONS_STANDARD=       none
21 VOPTS[v11]=             PY311=ON PY312=OFF
22 VOPTS[v12]=             PY311=OFF PY312=ON
23
24 DISTNAME=               fs-2.4.16.dist-info
25
26 GENERATED=              yes
27
28 [PY311].RUN_DEPENDS_ON=                 python-appdirs:single:v11
29                                         python-setuptools:single:v11
30                                         python-six:single:v11
31 [PY311].USES_ON=                        python:v11,wheel
32
33 [PY312].RUN_DEPENDS_ON=                 python-appdirs:single:v12
34                                         python-setuptools:single:v12
35                                         python-six:single:v12
36 [PY312].USES_ON=                        python:v12,wheel
37
38 [FILE:2706:descriptions/desc.single]
39 # PyFilesystem2
40
41 Python's Filesystem abstraction layer.
42
43 [PyPI version]
44 [PyPI]
45 [Downloads]
46 [Build Status]
47 [Windows Build Status]
48 [Coverage Status]
49 [Codacy Badge]
50 [Docs]
51
52 ## Documentation
53
54 - [Wiki]
55 - [API Documentation]
56 - [GitHub Repository]
57 - [Blog]
58
59 ## Introduction
60
61 Think of PyFilesystem's `FS` objects as the next logical step to
62 Python's `file` objects. In the same way that file objects abstract a
63 single file, FS objects abstract an entire filesystem.
64
65 Let's look at a simple piece of code as an example. The following
66 function uses the PyFilesystem API to count the number of non-blank
67 lines of Python code in a directory. It works _recursively_, so it will
68 find `.py` files in all sub-directories.
69
70 ```python
71 def count_python_loc(fs):
72     """Count non-blank lines of Python code."""
73     count = 0
74     for path in fs.walk.files(filter=['*.py']):
75         with fs.open(path) as python_file:
76             count += sum(1 for line in python_file if line.strip())
77     return count
78 ```
79
80 We can call `count_python_loc` as follows:
81
82 ```python
83 from fs import open_fs
84 projects_fs = open_fs('~/projects')
85 print(count_python_loc(projects_fs))
86 ```
87
88 The line `project_fs = open_fs('~/projects')` opens an FS object that
89 maps to the `projects` directory in your home folder. That object is
90 used by `count_python_loc` when counting lines of code.
91
92 To count the lines of Python code in a _zip file_, we can make the
93 following change:
94
95 ```python
96 projects_fs = open_fs('zip://projects.zip')
97 ```
98
99 Or to count the Python lines on an FTP server:
100
101 ```python
102 projects_fs = open_fs('ftp://ftp.example.org/projects')
103 ```
104
105 No changes to `count_python_loc` are necessary, because PyFileystem
106 provides a simple consistent interface to anything that resembles a
107 collection of files and directories. Essentially, it allows you to write
108 code that is independent of where and how the files are physically
109 stored.
110
111 Contrast that with a version that purely uses the standard library:
112
113 ```python
114 def count_py_loc(path):
115     count = 0
116     for root, dirs, files in os.walk(path):
117         for name in files:
118             if name.endswith('.py'):
119                 with open(os.path.join(root, name), 'rt') as python_file:
120                     count += sum(1 for line in python_file if line.strip())
121     return count
122 ```
123
124 This version is similar to the PyFilesystem code above, but would only
125 work with the OS filesystem. Any other filesystem would require an
126 entirely different API, and you would likely have to re-implement the
127 directory walking functionality of `os.walk`.
128
129 ## Credits
130
131 The following developers have contributed code and their time to this
132 projects:
133
134 - [Will McGugan]
135 - [Martin Larralde]
136 - [Giampaolo Cimino]
137 - [Geoff Jukes]
138
139
140
141 [FILE:109:distinfo]
142 660064febbccda264ae0b6bace80a8d1be9e089e0a5eb2427b7d517f9a91545c       135261 fs-2.4.16-py2.py3-none-any.whl
143