![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
syncano-server
Advanced tools
This library supposed to be used in Syncano Sockets (inside scripts) to communicate with Syncano Core Services. Syncano provides various Core Services:
To initialize library simply type:
import { data, users, socket, response, event } from 'syncano-server'
Library initiated that way will grab necessary information from the context of you Socket Script - it means that you don't need to provide additional information such as Instance name or authentication key (token) to your Instance.
If you want to force the library to connect to specified instance type:
import server from 'syncano-server'
const { data, events } = server({
token: '9-12jdiasdnfo23nrokms',
instanceName: 'example-instance-name'
})
In this example tags
is a name of a class (data model) configured for that instance.
// Create new object in tags class
data.tags
.create({
name: 'javascript',
usage_count: 0
})
.then(tag => {});
// Get list of 140 tags used more than 100 times
data.tags
.where('usage_count', 'gt', 100)
.take(140)
.list()
.then(tags => {})
// Get list of post where author is reference to other class
// and author email is john@example.com
data.posts
.where('author.email', 'john@example.com')
.list()
.then(posts => {})
// Get list of post - author column will be expanded with data from target class
data.posts
.with('author')
.list()
.then(posts => {})
// Delete tags with with given array of ids
data.tags.delete([8735, 8733])
// Delete single tag
data.tags.delete(7652)
// Get first user with given mail
data.users
.where('email', 'john.doe@example.com')
.first()
.then(user => {
// user variable is null if not found
// so no need for catch method
})
// Get first user with given mail, throws error if user was not found
data.users
.where('email', 'john.doe@example.com')
.firstOrFail()
.then(user => {})
.catch(err => {
// error is thrown if user was not found
})
event.emit('my_signal', {dummyKey: 'dummy_value'})
.then(event => {})
.catch(err => {
// error is thrown if emit was unsuccessful
})
const latestTags = await socket.get('tags/list', { sort: 'latest' })
const createdTag = await socket.post('tags/create', { name: 'nature' })
// Simple text/plain response
// response(content, status, contentType, headers)
response('Hello world')
// Respond with custom header
response('Check headers')
.header('X-RATE-LIMIT', 50)
.header('X-USAGE', 35)
// Fetch latest post and return it as json
data.posts
.where('status', 'published')
.where('is_featured', true)
.firstOrFail()
.then(post => {
response().json(post)
})
.catch(err => {
// error is thrown if post was not found
})
Check documentation to learn more.
FAQs
A library to intereact with the Syncano API on a server side
The npm package syncano-server receives a total of 2 weekly downloads. As such, syncano-server popularity was classified as not popular.
We found that syncano-server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.