If you have read the official docs, you should hopefully be able to be able to write high spectacle network servers and clients with asyncio.

If you have read the official docs, you should hopefully be able to be able to write high performance network servers and clients with asyncio.

Posts about technology, with a concentrate on web development with Python.

Stream BTC prices overheen WebSockets with Python and Lomond

WebSockets is a superb technology with many applications beyond the vuurlijn end. I have a feeling that websocket APIs will become far more common ter the web ecosphere.

I indeed like this example of how to interact with a WebSockets api with just-released Lomond 0.1.Five.

This connects to the gdax websocket server and periodically prints the latest BTC price information. If you switch the text “ticker” to “level2” it will spew out information on every trade. You could use this spil the foundation for algorithmic trading or to keep an eye on your retirement fund (good luck).

Lomond is a websocket client library sponsored by Dataplicity. It has a concentrate on robustness and ease of use. proceed reading…

Lifting the Curtain on Asyncio Magic – Part 1

The fresh asyncio module introduced ter Python3.Four is a nice addition to the Python standard library, especially when used with the async and await keywords introduced ter Python3.Five.

If you have read the official docs, you should hopefully be able to be able to write high spectacle network servers and clients with asyncio. But if something goes wrong, you may find it hard to debug. This is no reflection on asyncio, concurrency and IO are deceptively ingewikkeld things, and asyncio is the point they meet.

I suspect that the problem with debugging asyncio projects is that async code doesn’t run itself. You are dependant on a rather large assets of code to run your code for you, and the distinction inbetween your code library code is far more blurry than you may be used to. proceed reading…

Amazon S3 Filesystem for Python

I’d like to announce an fresh Python module to make working with Amazon S3 files a entire lotsbestemming lighter.

The S3FS class ter fs-s3fs wraps an Amazon S3 bucket te a PyFilesystem interface. There wasgoed an S3FS class built te to the very first version of PyFilesystem, but it had suffered from using an older version of ‘boto’ (Amazon’s S3 interface) and wasgoed ter need of maintenance. The fresh version is up-to-date with PyFilesystem2 and boto3, and works with Python2.7 and Python3.X.

If you aren’t corriente with PyFilesystem, it is a common interface to anything that resembles a filesystem. Amazon S3 isn’t finta a total filesystem, but close enough that it can be made to work te the same way spil the files and directories on your locorregional drive (or any other supported filesystem for that matter). proceed reading…

PyFilesystem Two.0.Four Released

PyFilesystem is an abstraction layer for filesystems (or anything that resembles a filesystem). See this postbode for more details.

This version adds support for Python3.6 os.pathlike to the OSFS class. This is ter oft-requested feature, but it only affects the OSFS constructor, since FS methods use a standardized path format.

Also ter the version is a contribution by Martin Larralde which implements an stijlvol extension mechanism. Essentially, if you layout your filesystem implementation according to the convention, then PyFilesystem will be aware of it automatically. So open_fs(‘awesomefs://foo/tapkast’) would work without explicitly adding awesomefs to the core library. proceed reading…

Announcing Lomond, a WebSocket Client Library for Python

I’d like to announce the very first official release of Lomond, a fresh WebSocket client library for Python. The development wasgoed sponsored by Dataplicity.

Lomond is not the very first websocket client for Python, so why go to the effort of building another one? For our purposes, wij needed a stand alone client that didn’t need a framework to run. So that excludes the websocket client support te Wervelstorm, aiohttp etc. The two libraries that were suitable for our product, websocket-client and ws4py, both had show-stopper bugs with ssl support, websocket-client would sometimes reject to processes packets until extra gegevens wasgoed received, and ws4py could lose entire packets. I’m sure both libraries could be immovable, but neither project emerges to be actively maintained. proceed reading…

PyFilesystem Two.0.Trio Released

I’ve just released version Two.0.Three of PyFilesystem.

PyFilesystem is an abstraction layer for filesystems (or anything that resembles a filesystem). See this postbode for more details.

Fresh te this version is a TarFS filesystem contributed by Martin Larralde, which compliments ZipFS nicely.

Contributed by gpcimino, the copy module wasgoed extended fresh functionality to selectively copy only fresh files from one filesystem to another. Very useful for backups.

This is ter addition to bugfixes, and improved documentation.

Speeding up Websockets 60X

I recently I had the chance to speed up some Websocket code that wasgoed a major knelpunt. The final solution wasgoed 60X (!) swifter than the very first pass, and an interesting exercise ter optimizing internal loops.

When you send gegevens via a websocket it is masked with a randomly generated four byte key. This masking provides protection from certain exploits against proxies (details here). The algorithm is super plain, essentially each byte ter the payload is XORed with a corresponding byte from the key.

The very first version of my XOR mask function looked this:

That’s the zuigeling of unfussy and stijlvol code you want to write for a job vraaggesprek. If that’s the solution that very first came to mind, then you know your Python. Alas, this code is spil slow spil it is beautiful. proceed reading…

Can your Python template do this?

I like to imagine components of a Python web framework spil personalities. Here’s how I would imagine a conversation inbetween a typical view and template would go down:

View Here’s that gegevens I just looked up.

View You can switch the format if you like.

Template Don’t wanna. You switch it.

View OK. Fine. I’ll switch it for you.

Which is why I wished Moya templates to be very capable ter processing gegevens, but still keep them designer friendly. If the template gegevens is sane then the template should be able to overeenkomst with it, without going back to the back-end developer. proceed reading…

Related movie: Using GDax Outside USA


You may also like...

3 Responses

  1. janinag47 says:

    But what they did not say at the commence that they are going to punt them very late, at the early 2018, which is pretty bad spil the price is very likely going to be much lower by then.

  2. PossibleMommyToBe says:

    Welp, it looks like Coinbase is going to credit the BCS after all the complaints from people who didn’t take their funds out ter time. People are truly fortunate that they are doing this.

  3. stoner43 says:

    Coinbase will learn the hard way that forked coins belong to the users. No warnings beforehand will switch that.

Leave a Reply

Your email address will not be published. Required fields are marked *