Comments (4)
I'm not sure I understand. Can you be more specific? As it is now, any arguments/keyword arguments after the first path argument will get passed to the fsspec FS. Are you having trouble with that?
from universal_pathlib.
I'm not sure I understand. Can you be more specific? As it is now, any arguments/keyword arguments after the first path argument will get passed to the fsspec FS. Are you having trouble with that?
Yes. I'm trying to achieve 'argument parity' b/w fsspec and upath. fsspec.filesystem expects the fs type as a first argument, while with upath I have to append a ':/'; example file
vs file:/
.
from universal_pathlib.
I just realized I overlooked the title of this issue which is where some of my confusion came from. Im open to adding a UPath.from_fs
constructor. Alternatively, UPath
could potentially be setup like UPath(path=None, protocol=None, filesystem=None, **kwargs)
. Making each of these keyword arguments optional, so you could specify just a protocol, and UPath would setup the filesystem for you, or you could pass an already created fsspec.filesystem
instance to the filesystem keyword argument. What do you think about that?
from universal_pathlib.
I just realized I overlooked the title of this issue which is where some of my confusion came from. Im open to adding a
UPath.from_fs
constructor. Alternatively,UPath
could potentially be setup likeUPath(path=None, protocol=None, filesystem=None, **kwargs)
. Making each of these keyword arguments optional, so you could specify just a protocol, and UPath would setup the filesystem for you, or you could pass an already createdfsspec.filesystem
instance to the filesystem keyword argument. What do you think about that?
That works. Though personally I've been really liking class constructors especially for objects that can get created in more than one way.
from universal_pathlib.
Related Issues (20)
- FSSpecFlavour implementation for URI handling
- fsspec URL chaining
- UPath instance check
- Creating new path objects of same type HOT 2
- Updating the example notebook HOT 2
- Python 3.10: TypeError: PurePath._from_parts() got an unexpected keyword argument 'init' HOT 1
- move to fsspec? HOT 5
- UPath isn't serializing correctly HOT 2
- s3 prefix with a + character causes incorrect path when iterating
- Feature Request: Add adlfs support
- Copy a UPath object
- Add type annotations to UPath
- Add default implementations for is_symlink etc.
- SSH protocol does not work HOT 2
- UPath incorrectly creates a parent object after calling UPath.parents method
- 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 5
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.