Skip to main content

csharp-like-file

If you've ever used C# and found yourself missing the sheer convenience of System.IO.File and System.IO.Directory, you're not alone. I've always loved how those static methods make file operations feel so effortless, so I decided to bring that same "vibe" to Python.

I originally built this just to scratch my own itch, so it's not meant to be some over-engineered masterpiece. It's just a straightforward tool to help you get things done. If you run into a bug or realize I missed a standard C# method you can't live without, just give me a shout in the issues!

Quick Example

import csdir
import csfile

directory = csdir.create_directory("test_folder")  # This returns a pathlib.Path object
csfile.write_all_text(directory / "hello.txt", "Hello World")

Differences from the C# Version

There are a couple of small "cultural" differences between Python and C# that you should know about.

Encoding (encoding)

I've set the default text encoding to UTF-8. I'm not a big fan of C#'s Encoding.Default (which can be a bit unpredictable depending on your OS). You can always pass your own encoding parameter if you need something specific.

Path Resolution

In C#, a path like a/b/.. is usually treated as a pure string operation. In that world, it always simplifies to a. But sometimes, if b is actually a symlink pointing somewhere else, you may expect that .. should take you to the real parent of that target.

However, the meaning of delete and exist clear, we kept the C# behavior. Therefore, when you call delete on a symlink file, it will certainly removing the symlink itself, rather than its destination. If you want to resolve the symlinks, call pathlib.Path.resolve or os.path.realpath before passing the paths into this package.

Metadata

Release files for csharp_like_file 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for csharp_like_file 0.0.8
File Size Uploaded Provenance
csharp_like_file-0.0.8.tar.gz 2.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for csharp_like_file 0.0.8
File Interpreter ABI Platform
csharp_like_file-0.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 5.6 kB

Release files / csharp_like_file-0.0.8.tar.gz

Download URL csharp_like_file-0.0.8.tar.gz
Size 2.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e936f3cbda6140dd24258ddc851a572a3e21101be8e31a2cf5090ba51977f271
BLAKE2b-256 checksum
How to use checksums
55f7140b7b6dce0b3ce72305ea3bcd3db02902146eeae4a6b928338304d48f0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / csharp_like_file-0.0.8-py3-none-any.whl

Download URL csharp_like_file-0.0.8-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
270b2ce9ef34151c0f4ebc3966f4e3d902d51d88e0ab17b1f893ff41ac08464f
BLAKE2b-256 checksum
How to use checksums
92abd91d94423bc0c80c0a391d9d06472e9b5f1015acaed9c0c838db468a7128
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for csharp_like_file 0.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page