Python module for interacting with the MidJourney API
Project description
PyJourney
A python module for calling the Midjourney API to get job details and for creating jobs.
Currently just trying to fix midjourney-graph and figured i'd break out the api calls into a module.
TODO
- more than 35 jobs at a time.
- jobs by date range, type, and for other users
- get sepcific job details for a job and a list of jobs
- get the list of community jobs by hot, new, trending, etc.
- Searching for jobs by title, description, and tags
Installation
pip install pyjourney
Setup
Create a .env file in the root of your project and add the following:
MIDJOURNEY_COOKIE=your_cookie
MIDJOURNEY_USERID=your_userId
The userID should be the newer GUID version of the userid, not the old integer version. The cookie can be taken from the cookie header in your browser when you're logged in to Midjourney for any request against the API.
Usage
from pyjourney import MidjourneyAPI
api = MidjourneyAPI() #Loads your cookie and userId from the .env file (required for now.)
request = api.recent_jobs() # Defaults to fetching the most recent 35 jobs you've done.
print(request.status_code) # request.json() should work if this is 200 :)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyjourney-0.1.7.tar.gz
(4.0 kB
view details)
Built Distribution
File details
Details for the file pyjourney-0.1.7.tar.gz
.
File metadata
- Download URL: pyjourney-0.1.7.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.7 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6b88afbdfdea73c83b2e9ee6eec9341583b277d8a920a177f341749249b55f6 |
|
MD5 | 5dd1d42a69940d5d98f6eff480b777ba |
|
BLAKE2b-256 | ecceb529bf0bf7b36bd9a34578e25e301527a6250008ff389bc14130378bc371 |
File details
Details for the file pyjourney-0.1.7-py3-none-any.whl
.
File metadata
- Download URL: pyjourney-0.1.7-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.7 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b044411e8a34d63473bb0448962f113b5c17c504a0bfccd6ac778418d66aa2f |
|
MD5 | 5549b065c247a6cf6db1fb331a02e798 |
|
BLAKE2b-256 | cbb47325afd2edfc8a64db1e86f291e055544a8aaae231ac959cedebdb29a6f7 |