معرفی شرکت ها


cohost-0.2.6


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

Unofficial Python API wrapper for Cohost.org - the fourth website!
ویژگی مقدار
سیستم عامل -
نام فایل cohost-0.2.6
نام cohost
نسخه کتابخانه 0.2.6
نگهدارنده []
ایمیل نگهدارنده ['Val Knight <val@valknight.xyz>']
نویسنده -
ایمیل نویسنده Val Knight <val@valknight.xyz>
آدرس صفحه اصلی -
آدرس اینترنتی https://pypi.org/project/cohost/
مجوز MIT License Copyright (c) 2022 Vallerie Knight Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Cohost.py ![Edit of Eggbug into the python logo](pybug_small.png) A python library for Cohost! ## Hyperstart > `pip install cohost` ## Quickstart > `pip install cohost` ```python3 from cohost.models.user import User from cohost.models.block import AttachmentBlock, MarkdownBlock cookie = 'yourCookie' user = User.loginWithCookie(cookie) # Alternatively: use a username/password combo # import os # user = User.login(os.getenv("COHOST_USER"), os.getenv("COHOST_PASS")) for project in user.editedProjects: print(project) # Print all pages you have edit permissions for project = user.getProject('vallerie') # will retrieve the page I have edit writes for with handle @vallerie blocks = [ AttachmentBlock('pybug.png'), # References image file pybug.png MarkdownBlock('**Hello from Python!**') # Example of markdown / text block ] newPost = project.post('Title of python post!', blocks, tags=['cohost.py', 'python']) print('Check out your post at {}'.format(newPost.url)) ``` ## Getting started 1. Have an activated Cohost.org account. This entire library will probably explode if you use it with an unactivated account, and it defo isn't some bypass. 2. Install library with `pip install cohost` 3. Log in with a cookie or a username/password 4. Import data models you require, and go from there! ## Terminology Some things are different on the API, and on the UI, and for the most part this library will match the API's terminology. Some key concepts: - A user is minimal - it will contain authentication, email, and some other key details but not much else - All the pages you can edit are referred to as "projects" - Each post is made up content "Blocks" ## Retrieving your cookie One way to login is to use an authentication token for Cohost. This can be retrieved by: 1. Open Developer Tools in your browser 1. Go to "Storage" 1. Find the "Cookies" entry 1. Copy the data for "`connect.sid`". 1. Use this in the library ## What's working? (allegedly) - Logging in as a user (using either a cookie or a username/password) - Retrieving projects of a user (and of other people when you got a post to go with it) - Retrieving posts of a page - Posting to a page - Attaching images to a post (with alt-text support!) - Editing posts - Retrieving notifications with pagination ## What's not done but needs to be done? - Retrieving single posts - currently have to read entire projects - Retrieving a project's drafts - Retrieving a projects of others without a post inbetween - Sharing posts (with comment) - Editing profiles - Deleting posts - Likely a whole bunch of other things I haven't thought about - Better docs ## What's not implemented intentionally? Some features I intend not to add. These features aren't impossible to build, but, they could be detrimental to the Cohost experience for other users, send mass notifications without an account being activated, or pose security issues. This is designed to deter low effort malicious bots, to reduce the workload on Cohost's staff. These include: - Editing a user's password - Accepting follow requests - Sharing a post without a comment - Creating new projects If you implement these features, please keep them **private** for your projects. If you think one of these should be implemented, please file a GitHub issue with your case as to why. ## Support Cohost [Buy Cohost PLUS](https://cohost.org/rc/user/settings) ## Follow me on Cohost! [hello is me](https://cohost.org/vallerie) ## Thanks - [cohost.js](https://github.com/mogery/cohost.js/) - provided a good point to start looking at how to go about this, and how cohost works in fundamental aspects. also has a working login thing which i need to properly understand at some point - [cohost.org](https://cohost.org) - home of eggbug - [requests](https://requests.readthedocs.io/en/latest/) - i would be lost in python if it weren't for requests, my beloved - the random tumblr anon who sent me an activation link - thanks


نیازمندی

مقدار نام
- requests


زبان مورد نیاز

مقدار نام
>=3.7 Python


نحوه نصب


نصب پکیج whl cohost-0.2.6:

    pip install cohost-0.2.6.whl


نصب پکیج tar.gz cohost-0.2.6:

    pip install cohost-0.2.6.tar.gz