Giter VIP home page Giter VIP logo

Comments (5)

normanrz avatar normanrz commented on July 17, 2024

What would be the use case for this? Why not just use a bytes buffer?

from universal_pathlib.

joouha avatar joouha commented on July 17, 2024

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.

ap-- avatar ap-- commented on July 17, 2024

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.

normanrz avatar normanrz commented on July 17, 2024

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.

joouha avatar joouha commented on July 17, 2024

Fair enough

from universal_pathlib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.