Comments (5)
What would be the use case for this? Why not just use a bytes
buffer?
from universal_pathlib.
My use case is for loading resources from web pages, such as images or CSS style-sheets. A resource link is typically a web address or a data URI:
<img src="http://example.com/image.png">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==">
A DataPath
class would allow universal_pathlib
to be used to load both of these resources without having to handle data URIs separately - making it even more universal.
I currently have a DataPath
implementation, which I register in upath.core.registry
to make this work.
I was wondering if you'd consider including non-fsspec
backed Path
classes as part of this library?
from universal_pathlib.
I currently don't see how this is a good use case. If I understand correctly, the only useful method would be .read_bytes()
, and none of the others would make sense in this example.
Is there another example with data uris that requires more functionality for path handling?
from universal_pathlib.
I agree with @ap--. If you have a DataPath
implementation and can register that with upath
in your application, that is great! I don't think it is a great fit for this library because there is limited added-value in terms of path handling.
from universal_pathlib.
Fair enough
from universal_pathlib.
Related Issues (20)
- Adhere to semver and add a changelog
- UPath broken in Python 3.11
- The noxfile has to be changed to support newer nox versions
- UPath with_name, with_stem, with_suffix is broken
- Glob on s3 bucket should be coherent with other implementations? HOT 1
- Handling of absolute file:// paths HOT 6
- mkdir does not respect exist_ok when parents is set to True
- Accessing the underlying filesystem HOT 8
- URI paths are incorrectly parsed as posix paths HOT 3
- Updating admins/maintainers HOT 3
- Use `urllib.parse.urljoin` when joining paths HOT 5
- Should `UPath.__new__` return `pathlib.Path` instances for local paths HOT 16
- Should the `UPath` public class API be identical to the public `pathlib.Path` class API HOT 2
- URI query component is ignored when opening a file HOT 5
- Inconsistency with Path HOT 3
- `joinpath` does not update url
- Refactor tests HOT 3
- Updating package dev tools HOT 4
- Add ability to register custom UPath implementations HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from universal_pathlib.