UNOFFICIAL MEOCLOUD PACKAGE
Use pip to install the latest stable version of meocloud
:
$ pip install meocloud
Before, create a new app in https://meocloud.pt/my_apps, then:
meocloud mycredential
from meocloud.services import MeoCloud
consumer_key='***'
consumer_secret='***'
oauth_token='***'
oauth_token_secret='***'
meo = MeoCloud(consumer_key=consumer_key, consumer_secret=consumer_secret, oauth_token=oauth_token, oauth_token_secret=oauth_token_secret)
print(meo.get_list('/'))
before you need run pip install requests
import requests
from meocloud.services import MeoCloud
meo = MeoCloud(consumer_key=consumer_key, consumer_secret=consumer_secret, oauth_token=oauth_token, oauth_token_secret=oauth_token_secret)
auth = meo.auth_in_request()
url = f'https://api.meocloud.pt/1/List/meocloud('
r = requests.get(url=url, auth=auth)
r.content
If you have questions, send them to [email protected]
The improvements made by digfish were: storing the received credentials in a .env and a REPL for the most basic commands: like retrieving files, upload them, delete and list, in the likeness of the FTP command. To call the REPL type:
> meocloudrepl
Welcome to meo cloud repl!
Enter Press Tab to see commands
help <cmd> or ?<cmd> for description
^D or exit to quit
meocloud [/]>
The following commands are implemented:
- cat
- exit
- help
- lls
- mkdir
- properties
- pwd
- rcd
- rup
- del
- get
- lcd
- lup
- mls
- put
- rcat
- rls
To know the meaning of each one, write help <cmd>
.
In alternative to the REPL you can provide arguments in the command line, the following commands are available:
rls <dir> list remote dir <dir>
mls <dir> idem
put <file> save the file in remote dir
get <file> downloads the file locate in remote dir
del <path> deletes the remote path
mkdir <dir> creates the remote dir
md <file> metadata of remote file
for example meocloudrepl rls /
will list the contents of the remote dir
Comments and improvements: [email protected]