<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[کتابخانه پایتون برای وب سرویس فایلز - Files.ir]]></title><description><![CDATA[<p dir="auto">سلام معرفی کتابخانه async برای api وبسایت - <strong>افزونه غیر رسمی</strong> - <strong>توسط تیم فایلز تست نشده است</strong><br />
<a href="https://github.com/loopy-iri/aiofilesir" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/loopy-iri/aiofilesir</a></p>
<hr />
<h1>filesir-async-client</h1>
<p dir="auto">Asynchronous Python 3.10+ client for the <a href="https://files.ir" target="_blank" rel="noopener noreferrer nofollow ugc">Files.ir</a> REST API.</p>
<p dir="auto">Built on <code>httpx.AsyncClient</code> and <code>pydantic</code> v2. Provides typed coroutines for every endpoint<br />
in the OpenAPI spec, automatic Bearer-token injection, configurable retry + exponential<br />
backoff, and a high-level <code>upload_file</code> helper that auto-selects the right session-based<br />
upload strategy (<code>single</code>, <code>s3-single</code>, <code>s3-multipart</code>, <code>tus</code>).</p>
<h2>Install</h2>
<p dir="auto">From PyPI (when published):</p>
<pre><code class="language-bash">pip install filesir-async-client
</code></pre>
<p dir="auto">Directly from this Git repository (recommended for now):</p>
<pre><code class="language-bash">pip install "git+https://github.com/loopy-iri/aiofilesir.git"
</code></pre>
<p dir="auto">Pin to a tag or branch:</p>
<pre><code class="language-bash">pip install "git+https://github.com/loopy-iri/aiofilesir.git@v0.1.0"
pip install "git+https://github.com/loopy-iri/aiofilesir.git@main"
</code></pre>
<p dir="auto">Add to <code>requirements.txt</code>:</p>
<pre><code>filesir-async-client @ git+https://github.com/loopy-iri/aiofilesir.git@main
</code></pre>
<h2>Quick start</h2>
<pre><code class="language-python">import asyncio
from filesir import FilesIrClient


async def main() -&gt; None:
    async with FilesIrClient(access_token="pat_...") as client:
        usage = await client.storage.space_usage()
        print(usage.used, usage.available, usage.remaining)

        folder = await client.folders.create(name="reports")

        entry = await client.uploads.upload_file(
            "/tmp/big-video.mp4",
            parent_id=folder.id,
            progress=lambda done, total: print(f"{done}/{total}"),
        )

        # Build a direct GET URL with the access token in the query string.
        url = client.files.direct_download_url(entry.id)
        print("Direct URL:", url)

        await client.files.download_to_file(entry.id, "/tmp/copy.mp4")


asyncio.run(main())
</code></pre>
<h2>Authentication</h2>
<pre><code class="language-python"># From an existing personal access token (account settings &gt; developers).
client = FilesIrClient(access_token="pat_...")

# Or login by email/password and receive a token automatically.
client = await FilesIrClient.from_credentials(
    email="me@example.com",
    password="secret",
    token_name="my-script",
)
</code></pre>
<h2>Resources</h2>
<ul>
<li><code>client.auth</code> — register / login</li>
<li><code>client.storage</code> — space usage</li>
<li><code>client.files</code> — list / update / delete / move / duplicate / restore / download / <code>direct_download_url</code></li>
<li><code>client.folders</code> — create folder</li>
<li><code>client.uploads</code> — <code>upload_file()</code> (auto-strategy) / <code>upload_legacy()</code> / low-level sessions</li>
<li><code>client.sharing</code> — share / change-permissions / unshare</li>
<li><code>client.starring</code> — star / unstar</li>
<li><code>client.links</code> — shareable links</li>
<li><code>client.workspaces</code> — CRUD + members + invites + activity logs</li>
<li><code>client.tags</code> — list / attach / detach / sync</li>
</ul>
<h2>Live test script</h2>
<p dir="auto"><code>examples/live_upload_and_link.py</code> uploads a real file, prints the direct<br />
download URL and creates a public shareable link. Pass your token via the<br />
<code>FILESIR_TOKEN</code> environment variable (or edit <code>FALLBACK_TOKEN</code> inside the<br />
script):</p>
<pre><code class="language-bash">export FILESIR_TOKEN=pat_xxxxxxxxxxxx
python examples/live_upload_and_link.py /path/to/local-file.png
</code></pre>
<h2>License</h2>
<p dir="auto">MIT.</p>
]]></description><link>https://forum.files.ir/topic/16/کتابخانه-پایتون-برای-وب-سرویس-فایلز-files.ir</link><generator>RSS for Node</generator><lastBuildDate>Sun, 02 Aug 2026 13:33:07 GMT</lastBuildDate><atom:link href="https://forum.files.ir/topic/16.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 17 May 2026 17:48:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to کتابخانه پایتون برای وب سرویس فایلز - Files.ir on Mon, 18 May 2026 18:58:38 GMT]]></title><description><![CDATA[<p dir="auto">هر تغییری در api ایجاد شه در اولین فرصت بروز میکنم</p>
]]></description><link>https://forum.files.ir/post/22</link><guid isPermaLink="true">https://forum.files.ir/post/22</guid><dc:creator><![CDATA[loopy]]></dc:creator><pubDate>Mon, 18 May 2026 18:58:38 GMT</pubDate></item><item><title><![CDATA[Reply to کتابخانه پایتون برای وب سرویس فایلز - Files.ir on Mon, 18 May 2026 17:52:43 GMT]]></title><description><![CDATA[<p dir="auto">وقت بخیر</p>
<p dir="auto">ممنون از اشتراک گذاشتن این قطعه کد با اعضای فایلز.<br />
با بروز نگه داشتن کد های گیتهاب ما را یاری دهید.</p>
<p dir="auto">با تشکر</p>
]]></description><link>https://forum.files.ir/post/21</link><guid isPermaLink="true">https://forum.files.ir/post/21</guid><dc:creator><![CDATA[arta]]></dc:creator><pubDate>Mon, 18 May 2026 17:52:43 GMT</pubDate></item></channel></rss>